# Maintainer: Simon Rupf <simon@rupf.net>
pkgname=zarchive
pkgver=0.1.2
pkgrel=2
pkgdesc="Library for creating and reading zstd-compressed file archives (.zar)"
url="https://github.com/Exzap/ZArchive"
arch="all"
license="MIT-0"
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="
	cmake
	samurai
	zstd-dev
	"
subpackages="$pkgname-libs $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/Exzap/ZArchive/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/ZArchive-$pkgver"
options="!check" # no tests

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto -DNDEBUG" \
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto -DNDEBUG" \
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b9666e8e86e5162b4ee641905a288088311d5cd1af510b2fbf22eba722ad2d8ca43a081b14c0106743807eff256bac9a0cacbdeb06e8ccad0e8d5b9ed8fa886e  zarchive-0.1.2.tar.gz
"
